home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / dev / cross / 6502d.readme < prev    next >
Encoding:
Text File  |  2002-01-27  |  3.8 KB  |  74 lines

  1. Short:    6502 disassembler.
  2. Author:   Bart Trzynadlowski. Amiga port by (Ventzislav Tzvetkov)
  3. Uploader: drHirudo@Amigascne.org (Ventzislav Tzvetkov)
  4. Version:  0.1
  5. Type:     dev/cross
  6.  
  7. ==============================================================================
  8.                               6502d Version 0.1
  9.                     Written by Bart Trzynadlowski, 1999
  10.                     Amiga Port by Ventzislav Tzvetkov, 2002
  11. ==============================================================================
  12.  
  13. Feel free to do whatever you wish with this software, just remember that I
  14. have provided it "as is" and will not be held responsible for anything that
  15. occurs as a result of the software.
  16.  
  17. 6502d is a 6502 disassembler. It does not have any support for special file
  18. formats, it simply assumes the input file is a raw binary image. 
  19.         6502d uses the following command line to execute:
  20.  
  21.         6502d -f infile [-s start] [-h] [-v]
  22.  
  23.         The first argument, infile, is the flat binary image you wish to
  24. disassemble. The start argument is optional and specifies the offset to start
  25. disassembly at. It is given in hexadecimal. If input occurs past the end of
  26. the file 6502d displays an endless series of EOF characters. For help on usage
  27. you can use -h and for the version number you can use -v. If -h or -v are
  28. encountered on the command line they are processed and the program exits, no
  29. disassembly occurs. The -v option has higher precedence over -h.
  30.     Standard output is used to print, therefore output can be
  31. redirected (preferrably to a file) by using > outfile -- where outfile is
  32. the output file -- at the end of the command line.
  33.     6502d was compiled on a DOS box with DJ Delorie's DJGPP. The
  34. command line used was: gcc -o 6502d.exe 6502d.c comline.c disasm.c 
  35.         
  36. A 6502d line of output has the following format:
  37.  
  38. address         opcode  instruction [operand,operand]
  39.  
  40.         The address field is the file position. Addresses are implied to be
  41. hexadecimal numbers. The opcode field is the series of bytes printed in
  42. hexadecimal which make up the machine instruction. The instruction field is
  43. the mnemonic name of the given instruction. Operands when they occur are
  44. printed. With operands a hexadecimal number is specified by the $ prefix and
  45. an immediate value is specified by the # prefix.
  46.  
  47. Only documented instructions are supported in this release. Undocumented
  48. instructions are not recognized and are treated as described below. If demand
  49. arises I might add undocumented opcodes, but for now I do not need it myself.
  50. If an opcode is not recognized as a valid 6502 instruction then 6502d simply
  51. prints .DB $XX where XX is the byte value. If the last 3rd to last byte is not
  52. an instruction then all 3 of the last bytes in a file are not disassembled,
  53. instead they are printed as a series of .DBs. 
  54.         Displacements in branch instructions are NOT translated into absolute
  55. addresses. The hexadecimal value of the displacement is printed as is. The
  56. 6502 can branch 127 bytes up or down the code. The displacement format uses
  57. one's complement negation to specify wether to jump up or down the code. Bit 7
  58. alone decided the sign of the byte. Displacements are added/subtracted to the
  59. address that succeeds the instruction and its operand(s).
  60.         The ability to toggle between printing displacements or absolute
  61. addresses may be included in future versions of 6502d if any are made. Please
  62. do not bother me about this issue.
  63.  
  64. Version history:
  65.         * Version 0.0
  66.                 - Initial public release.
  67.         * Version 0.1
  68.                 - Now DEC ABS,X displays correctly. (DEC $FFFF,X instead of
  69.                   DEC $FFFF)
  70.                        
  71. Enjoy 6502d. The opcode matrix I used (source file opcode.h) is correct to the
  72. best of my knowledge. The much-less-than-fantastic as6502 assembler aided me
  73. in testing 6502d. 
  74.